
Partial Class login
    Inherits System.Web.UI.Page

#Region "Eventos"

    Protected Sub btnLogar_Click(ByVal sender As Object, ByVal e As System.EventArgs)

        Dim oUsuario As Usuario
        Dim oUsuarioDAL As UsuarioDAL

        Try

            oUsuario = New Usuario(Me.txtLogin.Text, Me.txtSenha.Text)
            oUsuarioDAL = New UsuarioDAL

            If oUsuarioDAL.Login(oUsuario) Then

                Session("Usuario") = oUsuario
                Response.Redirect("~/default.aspx")

            Else

                Me.lblMensagem.Text = Resources.Usuario.LoginFalha

            End If

        Catch ex As Exception

            Me.lblMensagem.Text = Resources.Geral.ErroGeral

        End Try

    End Sub

#End Region

End Class